package com.wuchao.abstractClasses;

import java.time.LocalDate;

/**
 * 作者：吴超
 * 邮箱：wuchao_19931120@163.com
 * 时间：2021-10-10
 * 描述：
 */

public class Employee extends Person{

    private double salary;
    private LocalDate hireDay;

    public Employee(String name,double salary,int year,int month,int day){
        super(name);
        this.salary = salary;
        hireDay = LocalDate.of(year,month,day);

    }

    public double getSalary(){
        return salary;
    }

    public LocalDate getHireDay(){
        return hireDay;
    }

    public void raiseSalary(double byPercent){
        double raise = salary * byPercent / 100;
        salary += raise;
    }

    @Override
    public String getDesc() {
        return String.format("an employee with a salary of $%.2f ", salary);
    }
}
